package com.crm.util;

import java.io.File;

import org.apache.log4j.Logger;

import com.crm.common.CrmInit;

public class FileEx {

	private static File uploadFile = new File(CrmInit.UPLOAD_PATH);
	
	private static Logger logger = Logger.getLogger(FileEx.class);

	public static File deleteFile(File file){
		String uploadPath = uploadFile.getPath();
		String ParentPath = file.getParentFile().getPath();
		if(file.isFile() && ParentPath.equals(uploadPath)){
			file.delete();
			logger.warn("Delete file:" + file.getPath());
		}
	    return file;
	}

}